package dev.ece.suit.hexmap;

import java.util.ArrayList;
import java.util.List;

import dev.ece.core.vertex.VAO;
import dev.ece.core.vertex.VBO;
import dev.ece.util.lib.Vector2f;
import dev.ece.util.lib.Vector3f;

public class MapWaterVAO {

	private VBO verticeVBO;
	
	private VBO uvVBO;
	
	private VBO normalsVBO;
	
	private VAO vao;
	
	public static MapWaterVAO createMapWaterVAO(MapCell[][] cells) {
		List<Vector3f> vertice = new ArrayList<Vector3f>();
		List<Vector2f> uv = new ArrayList<Vector2f>();
		List<Vector3f> normals = new ArrayList<Vector3f>();
		
		MapWaterVAO vao = new MapWaterVAO();
		vao.verticeVBO = VBO.newInstance3f(vertice);
		vao.uvVBO = VBO.newInstance2f(uv);
		vao.normalsVBO = VBO.newInstance3f(normals);
		
		vertice.clear();
		uv.clear();
		normals.clear();
		
		vertice = null;
		uv = null;
		normals = null;
		return vao;
	}
	
	public void initialize() {
		
	}
	
	public void destroy() {
		if(vao != null) {
			vao.destroy();
		}
	}
	
	public void bind() {
		vao.bind();
	}
	
}
